import logging
import traceback

from selenium.webdriver.common.by import By
from Base.Base import Base

class Pay_Page(Base):

    #点击支付管理
    dianji_loc=(By.XPATH,'//*[@id="sidebar"]/div[2]/div[7]/h2')
    #产品支付信息
    chanpin_loc=(By.XPATH,'//*[@id="sidebar"]/div[2]/div[8]/ul/li[1]/div/a')
    # 用户支配
    yhzhipei_loc = (By.XPATH, '//*[@id="sidebar"]/div[2]/div[8]/ul/li[2]/div/a')

    def chanpin(self):
        '''
        产品支付信息
        :return:
        '''
        try:
            self.click(self.chanpin_loc)
        except Exception as e:
            logging.info(traceback.format_exc(), e)

    def dianji(self):
        '''
        支付管理
        :return:
        '''
        try:
            self.click(self.dianji_loc)
        except Exception as e:
            logging.info(traceback.format_exc(), e)

    def yhzhiei(self):
        '''
        用户支配
        :return:
        '''
        try:
            self.click(self.yhzhipei_loc)
        except Exception as e:
            logging.info(traceback.format_exc(), e)